import Vue from "vue";
import Router from "vue-router";
import Index from "./views/index/Index.vue";

Vue.use(Router);

export default new Router({
  routes: [
    //首页
    {
      path: "/",
      name: "index",
      component: Index,
      meta:{
        sort:1
      }
    },
    //卡券详情
    {
      path:"/coupon_detail/:snapshot_id",
      name:"coupon_detail",
      component:() => import("./views/coupon_detail/couponDetail.vue"),
      meta:{
        title:"卡券详情",
        sort:10
      }
    },
    //会员中心
    {
      path: "/member",
      name: "member",
      component: () => import("./views/member/Member.vue"),
      meta:{
        title:"会员中心",
        sort:2
      },
      children:[
        //我的钱包
        {
          path: "/member/wallet",
          name: "wallet",
          component: () => import("./views/wallet/Wallet.vue"),
          meta:{
            title:"我的钱包",
            sort:3,
            child:true
          }
        },
        {
          path:"/member/coupon",
          name:"coupon",
          component: () => import("./views/coupon/Coupon.vue"),
          meta:{
            title:"我的卡券",
            sort:3,
            child:true
          }
        }
      ]
    },
    //活动页面
    {
      path: "/activity/:activity_id/:share_uid",
      name: "activity",
      meta:{
        title:"活动",
        sort:3
      },
      component: () => import("./views/activity/Activity.vue"),
      children:[
        //活动说明页面
        {
          path:"/activity/explain/:activity_id",
          name:"explain",
          component: () => import("./views/explain/Explain.vue"),
          meta:{
            title:"活动说明",
            sort:4,
            child:true
          }
        },
        //活动宝藏兑换页面
        {
          path:"/activity/exchange/:activity_id",
          name:"exchange",
          component: () => import("./views/exchange/Exchange.vue"),
          meta:{
            title:"宝藏兑换",
            sort:4,
            child:true
          }
        },
        //实物奖品兑换页面
        {
          path:"/activity/entity/:activity_id",
          name:"entity",
          component: () => import("./views/entity/Entity.vue"),
          meta:{
            title:"奖品兑换",
            sort:4,
            child:true
          }
        },
        //活动的卡券列表
        {
          path:"/activity/activity_coupon/:activity_id",
          name:"activity_coupon",
          component: () => import("./views/activity_coupon/ActivityCoupon.vue"),
          meta:{
            title:"我的卡券",
            sort:4,
            child:true
          }
        },
        //领券页面
        {
          path:"/activity/get_coupon/:activity_id",
          name:"get_coupon",
          component: () => import("./views/get_coupon/GetCoupon.vue"),
          meta:{
            title:"领券",
            sort:4,
            child:true
          }
        }
      ],
    }
  ]
});
